import random


qcc_cookies_ji = [
{
    "domain": ".qichacha.com",
    "hostOnly": False,
    "httpOnly": False,
    "name": "Hm_lpvt_3456bee468c83cc63fb5147f119f1075",
    "path": "/",
    "sameSite": "no_restriction",
    "secure": False,
    "session": True,
    "storeId": "0",
    "value": "1559273040",
    "id": 1
},
{
    "domain": ".qichacha.com",
    "expirationDate": 1590809040,
    "hostOnly": False,
    "httpOnly": False,
    "name": "Hm_lvt_3456bee468c83cc63fb5147f119f1075",
    "path": "/",
    "sameSite": "no_restriction",
    "secure": False,
    "session": False,
    "storeId": "0",
    "value": "1559273022",
    "id": 2
},
{
    "domain": ".qichacha.com",
    "expirationDate": 1559877839.55369,
    "hostOnly": False,
    "httpOnly": False,
    "name": "QCCSESSID",
    "path": "/",
    "sameSite": "no_restriction",
    "secure": False,
    "session": False,
    "storeId": "0",
    "value": "3ldc94t2t5fpelcskc8dmt2ot1",
    "id": 3
},
{
    "domain": ".qichacha.com",
    "expirationDate": 1574997822,
    "hostOnly": False,
    "httpOnly": False,
    "name": "UM_distinctid",
    "path": "/",
    "sameSite": "no_restriction",
    "secure": False,
    "session": False,
    "storeId": "0",
    "value": "16b0bea232b175-0a955355c2ae67-6353160-1fa400-16b0bea232c4ab",
    "id": 4
},
{
    "domain": ".qichacha.com",
    "expirationDate": 1590809040,
    "hostOnly": False,
    "httpOnly": False,
    "name": "zg_de1d1a35bfa24ce29bbf2c7eb17e6c4f",
    "path": "/",
    "sameSite": "no_restriction",
    "secure": False,
    "session": False,
    "storeId": "0",
    "value": "%7B%22sid%22%3A%201559273022139%2C%22updated%22%3A%201559273040282%2C%22info%22%3A%201559273022144%2C%22superProperty%22%3A%20%22%7B%7D%22%2C%22platform%22%3A%20%22%7B%7D%22%2C%22utm%22%3A%20%22%7B%7D%22%2C%22referrerDomain%22%3A%20%22www.qichacha.com%22%2C%22cuid%22%3A%20%22c6e366bf5a39d064c71a079b017a75e2%22%7D",
    "id": 5
},
{
    "domain": ".qichacha.com",
    "expirationDate": 1590809040,
    "hostOnly": False,
    "httpOnly": False,
    "name": "zg_did",
    "path": "/",
    "sameSite": "no_restriction",
    "secure": False,
    "session": False,
    "storeId": "0",
    "value": "%7B%22did%22%3A%20%2216b0bea22b471d-0afcb2b9cca0ba-6353160-1fa400-16b0bea22b58ce%22%7D",
    "id": 6
},
{
    "domain": "www.qichacha.com",
    "expirationDate": 1874633022,
    "hostOnly": True,
    "httpOnly": False,
    "name": "_uab_collina",
    "path": "/",
    "sameSite": "no_restriction",
    "secure": False,
    "session": False,
    "storeId": "0",
    "value": "155927302215214179269858",
    "id": 7
},
{
    "domain": "www.qichacha.com",
    "expirationDate": 1561951422.792707,
    "hostOnly": True,
    "httpOnly": True,
    "name": "acw_tc",
    "path": "/",
    "sameSite": "no_restriction",
    "secure": False,
    "session": False,
    "storeId": "0",
    "value": "ddc2939e15592730200983484ebef495ec3f26b6f2c09dc6f86f1d6ca1",
    "id": 8
},
{
    "domain": "www.qichacha.com",
    "expirationDate": 1574997840,
    "hostOnly": True,
    "httpOnly": False,
    "name": "CNZZDATA1254842228",
    "path": "/",
    "sameSite": "no_restriction",
    "secure": False,
    "session": False,
    "storeId": "0",
    "value": "2001165186-1559270391-https%253A%252F%252Fwww.qichacha.com%252F%7C1559270391",
    "id": 9
},
{
    "domain": "www.qichacha.com",
    "expirationDate": 1559316240,
    "hostOnly": True,
    "httpOnly": False,
    "name": "hasShow",
    "path": "/",
    "sameSite": "no_restriction",
    "secure": False,
    "session": False,
    "storeId": "0",
    "value": "1",
    "id": 10
}
]

qcc_cookies_long = [
{
    "domain": ".qichacha.com",
    "hostOnly": False,
    "httpOnly": False,
    "name": "Hm_lpvt_3456bee468c83cc63fb5147f119f1075",
    "path": "/",
    "sameSite": "no_restriction",
    "secure": False,
    "session": True,
    "storeId": "0",
    "value": "1559273084",
    "id": 1
},
{
    "domain": ".qichacha.com",
    "expirationDate": 1590809083,
    "hostOnly": False,
    "httpOnly": False,
    "name": "Hm_lvt_3456bee468c83cc63fb5147f119f1075",
    "path": "/",
    "sameSite": "no_restriction",
    "secure": False,
    "session": False,
    "storeId": "0",
    "value": "1559273072",
    "id": 2
},
{
    "domain": ".qichacha.com",
    "expirationDate": 1559877882.690718,
    "hostOnly": False,
    "httpOnly": False,
    "name": "QCCSESSID",
    "path": "/",
    "sameSite": "no_restriction",
    "secure": False,
    "session": False,
    "storeId": "0",
    "value": "f92h7egetuiucm1urlo78rate4",
    "id": 3
},
{
    "domain": ".qichacha.com",
    "expirationDate": 1574997871,
    "hostOnly": False,
    "httpOnly": False,
    "name": "UM_distinctid",
    "path": "/",
    "sameSite": "no_restriction",
    "secure": False,
    "session": False,
    "storeId": "0",
    "value": "16b0beae43a589-068bdc10e111b1-6353160-1fa400-16b0beae43b452",
    "id": 4
},
{
    "domain": ".qichacha.com",
    "expirationDate": 1590809083,
    "hostOnly": False,
    "httpOnly": False,
    "name": "zg_de1d1a35bfa24ce29bbf2c7eb17e6c4f",
    "path": "/",
    "sameSite": "no_restriction",
    "secure": False,
    "session": False,
    "storeId": "0",
    "value": "%7B%22sid%22%3A%201559273071587%2C%22updated%22%3A%201559273083364%2C%22info%22%3A%201559273071592%2C%22superProperty%22%3A%20%22%7B%7D%22%2C%22platform%22%3A%20%22%7B%7D%22%2C%22utm%22%3A%20%22%7B%7D%22%2C%22referrerDomain%22%3A%20%22www.qichacha.com%22%2C%22cuid%22%3A%20%22b0b19e1aababac25f005e18f4afe394f%22%7D",
    "id": 5
},
{
    "domain": ".qichacha.com",
    "expirationDate": 1590809083,
    "hostOnly": False,
    "httpOnly": False,
    "name": "zg_did",
    "path": "/",
    "sameSite": "no_restriction",
    "secure": False,
    "session": False,
    "storeId": "0",
    "value": "%7B%22did%22%3A%20%2216b0beae3d927e-0656687ed4bef9-6353160-1fa400-16b0beae3daa8%22%7D",
    "id": 6
},
{
    "domain": "www.qichacha.com",
    "expirationDate": 1874633071,
    "hostOnly": True,
    "httpOnly": False,
    "name": "_uab_collina",
    "path": "/",
    "sameSite": "no_restriction",
    "secure": False,
    "session": False,
    "storeId": "0",
    "value": "155927307174685645476683",
    "id": 7
},
{
    "domain": "www.qichacha.com",
    "expirationDate": 1561951472.572257,
    "hostOnly": True,
    "httpOnly": True,
    "name": "acw_tc",
    "path": "/",
    "sameSite": "no_restriction",
    "secure": False,
    "session": False,
    "storeId": "0",
    "value": "ddc2939e15592730699094197e2909a409b2d38a32cfaf4144702141bc",
    "id": 8
},
{
    "domain": "www.qichacha.com",
    "expirationDate": 1574997883,
    "hostOnly": True,
    "httpOnly": False,
    "name": "CNZZDATA1254842228",
    "path": "/",
    "sameSite": "no_restriction",
    "secure": False,
    "session": False,
    "storeId": "0",
    "value": "610532522-1559270391-https%253A%252F%252Fwww.qichacha.com%252F%7C1559270391",
    "id": 9
},
{
    "domain": "www.qichacha.com",
    "expirationDate": 1559316271,
    "hostOnly": True,
    "httpOnly": False,
    "name": "hasShow",
    "path": "/",
    "sameSite": "no_restriction",
    "secure": False,
    "session": False,
    "storeId": "0",
    "value": "1",
    "id": 10
}
]

qcc_cookies_jie = [
{
    "domain": ".qichacha.com",
    "hostOnly": False,
    "httpOnly": False,
    "name": "Hm_lpvt_3456bee468c83cc63fb5147f119f1075",
    "path": "/",
    "sameSite": "no_restriction",
    "secure": False,
    "session": True,
    "storeId": "0",
    "value": "1559273135",
    "id": 1
},
{
    "domain": ".qichacha.com",
    "expirationDate": 1590809134,
    "hostOnly": False,
    "httpOnly": False,
    "name": "Hm_lvt_3456bee468c83cc63fb5147f119f1075",
    "path": "/",
    "sameSite": "no_restriction",
    "secure": False,
    "session": False,
    "storeId": "0",
    "value": "1559273119",
    "id": 2
},
{
    "domain": ".qichacha.com",
    "expirationDate": 1559877933.902558,
    "hostOnly": False,
    "httpOnly": False,
    "name": "QCCSESSID",
    "path": "/",
    "sameSite": "no_restriction",
    "secure": False,
    "session": False,
    "storeId": "0",
    "value": "kbp9e3q1ru4p428tfo1hrlvvc2",
    "id": 3
},
{
    "domain": ".qichacha.com",
    "expirationDate": 1574997918,
    "hostOnly": False,
    "httpOnly": False,
    "name": "UM_distinctid",
    "path": "/",
    "sameSite": "no_restriction",
    "secure": False,
    "session": False,
    "storeId": "0",
    "value": "16b0beb9a8d884-0b59f8914a08ff-6353160-1fa400-16b0beb9a8ef3",
    "id": 4
},
{
    "domain": ".qichacha.com",
    "expirationDate": 1590809134,
    "hostOnly": False,
    "httpOnly": False,
    "name": "zg_de1d1a35bfa24ce29bbf2c7eb17e6c4f",
    "path": "/",
    "sameSite": "no_restriction",
    "secure": False,
    "session": False,
    "storeId": "0",
    "value": "%7B%22sid%22%3A%201559273118318%2C%22updated%22%3A%201559273134560%2C%22info%22%3A%201559273118321%2C%22superProperty%22%3A%20%22%7B%7D%22%2C%22platform%22%3A%20%22%7B%7D%22%2C%22utm%22%3A%20%22%7B%7D%22%2C%22referrerDomain%22%3A%20%22www.qichacha.com%22%2C%22cuid%22%3A%20%225c765706b232a058cf4f628d0db69595%22%7D",
    "id": 5
},
{
    "domain": ".qichacha.com",
    "expirationDate": 1590809134,
    "hostOnly": False,
    "httpOnly": False,
    "name": "zg_did",
    "path": "/",
    "sameSite": "no_restriction",
    "secure": False,
    "session": False,
    "storeId": "0",
    "value": "%7B%22did%22%3A%20%2216b0beb9a667c-09419fd4ff260f-6353160-1fa400-16b0beb9a6921f%22%7D",
    "id": 6
},
{
    "domain": "www.qichacha.com",
    "expirationDate": 1874633118,
    "hostOnly": True,
    "httpOnly": False,
    "name": "_uab_collina",
    "path": "/",
    "sameSite": "no_restriction",
    "secure": False,
    "session": False,
    "storeId": "0",
    "value": "155927311843685538245938",
    "id": 7
},
{
    "domain": "www.qichacha.com",
    "expirationDate": 1561951521.774801,
    "hostOnly": True,
    "httpOnly": True,
    "name": "acw_tc",
    "path": "/",
    "sameSite": "no_restriction",
    "secure": False,
    "session": False,
    "storeId": "0",
    "value": "ddc2939e15592731190485206e70c8f205bc6ae8e36b841a91b0940410",
    "id": 8
},
{
    "domain": "www.qichacha.com",
    "expirationDate": 1574997934,
    "hostOnly": True,
    "httpOnly": False,
    "name": "CNZZDATA1254842228",
    "path": "/",
    "sameSite": "no_restriction",
    "secure": False,
    "session": False,
    "storeId": "0",
    "value": "1492501679-1559270391-https%253A%252F%252Fwww.qichacha.com%252F%7C1559270391",
    "id": 9
},
{
    "domain": "www.qichacha.com",
    "expirationDate": 1559316318,
    "hostOnly": True,
    "httpOnly": False,
    "name": "hasShow",
    "path": "/",
    "sameSite": "no_restriction",
    "secure": False,
    "session": False,
    "storeId": "0",
    "value": "1",
    "id": 10
}
]

all_cookies = [
    # qcc_cookies_song,
    # qcc_cookies_koala,
    # qcc_cookies_figo,
    # qcc_cookies_xinnan,
    # qcc_cookies_yujing,
    # qcc_cookies_tony,
    # qcc_cookies_tony,
    # qcc_cookies_rui,
    # qcc_cookies_yang,
    # qcc_cookies_hao,
    # qcc_cookies_zhuang,
    # qcc_cookies_tony2,
    # qcc_cookies_tony3,
    # qcc_cookies_jinyu,
    # qcc_cookies_jinyu2,
    # qcc_cookies_jinyu3,
    # qcc_cookies_jinyu4,
    # qcc_cookies_jiajia,
    qcc_cookies_ji,
    # qcc_cookies_feng,
    qcc_cookies_long,
    qcc_cookies_jie,
    # qcc_cookies_clark,
    # qcc_cookies_winter,
    # qcc_cookies_sunny,
    # qcc_cookies_evan,
    # qcc_cookies_dl2,
    # qcc_cookies_kent,
    # qcc_cookies_zz,
    # qcc_cookies_zero,
    # qcc_cookies_lee,
    # qcc_cookies_haiyi,
    # qcc_cookies_Machina,
]

max_int = len(all_cookies) - 1


def get_random_cookie():
    i = random.randint(0, max_int)
    # print(f"随机 {i} ")
    return i, all_cookies[i]


def get_choose_cookie(i: int):
    if i < 0 or i > max_int:
        return get_random_cookie()
    else:
        # print(f"指定 {i}")
        return i, all_cookies[i]


def test_random():
    for i in range(100):
        r = random.randint(0, len(all_cookies) - 1)
        print(r)


if __name__ == "__main__":
    test_random()
